3.1278 \(\int x \tan ^{-1}(x) \log (1+x^2) \, dx\)

Optimal. Leaf size=49 \[ -\frac {1}{2} x \log \left (x^2+1\right )-\frac {1}{2} x^2 \tan ^{-1}(x)+\frac {1}{2} \left (x^2+1\right ) \log \left (x^2+1\right ) \tan ^{-1}(x)+\frac {3 x}{2}-\frac {3}{2} \tan ^{-1}(x) \]

[Out]

3/2*x-3/2*arctan(x)-1/2*x^2*arctan(x)-1/2*x*ln(x^2+1)+1/2*(x^2+1)*arctan(x)*ln(x^2+1)

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 8, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.800, Rules used = {4852, 321, 203, 2454, 2389, 2295, 5019, 2448} \[ -\frac {1}{2} x \log \left (x^2+1\right )-\frac {1}{2} x^2 \tan ^{-1}(x)+\frac {1}{2} \left (x^2+1\right ) \log \left (x^2+1\right ) \tan ^{-1}(x)+\frac {3 x}{2}-\frac {3}{2} \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

Int[x*ArcTan[x]*Log[1 + x^2],x]

[Out]

(3*x)/2 - (3*ArcTan[x])/2 - (x^2*ArcTan[x])/2 - (x*Log[1 + x^2])/2 + ((1 + x^2)*ArcTan[x]*Log[1 + x^2])/2

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2389

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2448

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)], x_Symbol] :> Simp[x*Log[c*(d + e*x^n)^p], x] - Dist[e*n*p, Int[
x^n/(d + e*x^n), x], x] /; FreeQ[{c, d, e, n, p}, x]

Rule 2454

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[I
nt[x^(Simplify[(m + 1)/n] - 1)*(a + b*Log[c*(d + e*x)^p])^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, e, m, n, p,
 q}, x] && IntegerQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0]) &&  !(EqQ[q, 1] && ILtQ[n, 0] &&
 IGtQ[m, 0])

Rule 4852

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*ArcTa
n[c*x])^p)/(d*(m + 1)), x] - Dist[(b*c*p)/(d*(m + 1)), Int[((d*x)^(m + 1)*(a + b*ArcTan[c*x])^(p - 1))/(1 + c^
2*x^2), x], x] /; FreeQ[{a, b, c, d, m}, x] && IGtQ[p, 0] && (EqQ[p, 1] || IntegerQ[m]) && NeQ[m, -1]

Rule 5019

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.))*(x_)^(m_.), x_Symbol] :> With
[{u = IntHide[x^m*(d + e*Log[f + g*x^2]), x]}, Dist[a + b*ArcTan[c*x], u, x] - Dist[b*c, Int[ExpandIntegrand[u
/(1 + c^2*x^2), x], x], x]] /; FreeQ[{a, b, c, d, e, f, g}, x] && IGtQ[(m + 1)/2, 0]

Rubi steps

\begin {align*} \int x \tan ^{-1}(x) \log \left (1+x^2\right ) \, dx &=-\frac {1}{2} x^2 \tan ^{-1}(x)+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\int \left (-\frac {x^2}{2 \left (1+x^2\right )}+\frac {1}{2} \log \left (1+x^2\right )\right ) \, dx\\ &=-\frac {1}{2} x^2 \tan ^{-1}(x)+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )+\frac {1}{2} \int \frac {x^2}{1+x^2} \, dx-\frac {1}{2} \int \log \left (1+x^2\right ) \, dx\\ &=\frac {x}{2}-\frac {1}{2} x^2 \tan ^{-1}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\frac {1}{2} \int \frac {1}{1+x^2} \, dx+\int \frac {x^2}{1+x^2} \, dx\\ &=\frac {3 x}{2}-\frac {1}{2} \tan ^{-1}(x)-\frac {1}{2} x^2 \tan ^{-1}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\int \frac {1}{1+x^2} \, dx\\ &=\frac {3 x}{2}-\frac {3}{2} \tan ^{-1}(x)-\frac {1}{2} x^2 \tan ^{-1}(x)-\frac {1}{2} x \log \left (1+x^2\right )+\frac {1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 38, normalized size = 0.78 \[ \frac {1}{2} \left (x^2 \left (-\tan ^{-1}(x)\right )+\log \left (x^2+1\right ) \left (\left (x^2+1\right ) \tan ^{-1}(x)-x\right )+3 x-3 \tan ^{-1}(x)\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x*ArcTan[x]*Log[1 + x^2],x]

[Out]

(3*x - 3*ArcTan[x] - x^2*ArcTan[x] + (-x + (1 + x^2)*ArcTan[x])*Log[1 + x^2])/2

________________________________________________________________________________________

fricas [A]  time = 0.39, size = 33, normalized size = 0.67 \[ -\frac {1}{2} \, {\left (x^{2} + 3\right )} \arctan \relax (x) + \frac {1}{2} \, {\left ({\left (x^{2} + 1\right )} \arctan \relax (x) - x\right )} \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="fricas")

[Out]

-1/2*(x^2 + 3)*arctan(x) + 1/2*((x^2 + 1)*arctan(x) - x)*log(x^2 + 1) + 3/2*x

________________________________________________________________________________________

giac [B]  time = 0.13, size = 86, normalized size = 1.76 \[ \frac {1}{4} \, \pi x^{2} \log \left (x^{2} + 1\right ) \mathrm {sgn}\relax (x) - \frac {1}{2} \, x^{2} \arctan \left (\frac {1}{x}\right ) \log \left (x^{2} + 1\right ) - \frac {1}{4} \, \pi x^{2} \mathrm {sgn}\relax (x) + \frac {1}{2} \, x^{2} \arctan \left (\frac {1}{x}\right ) + \frac {1}{4} \, \pi \log \left (x^{2} + 1\right ) \mathrm {sgn}\relax (x) - \frac {1}{2} \, x \log \left (x^{2} + 1\right ) - \frac {1}{2} \, \arctan \left (\frac {1}{x}\right ) \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x - \frac {3}{2} \, \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="giac")

[Out]

1/4*pi*x^2*log(x^2 + 1)*sgn(x) - 1/2*x^2*arctan(1/x)*log(x^2 + 1) - 1/4*pi*x^2*sgn(x) + 1/2*x^2*arctan(1/x) +
1/4*pi*log(x^2 + 1)*sgn(x) - 1/2*x*log(x^2 + 1) - 1/2*arctan(1/x)*log(x^2 + 1) + 3/2*x - 3/2*arctan(x)

________________________________________________________________________________________

maple [C]  time = 1.57, size = 2240, normalized size = 45.71 \[ \text {Expression too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*arctan(x)*ln(x^2+1),x)

[Out]

-1/2*x^2*arctan(x)-ln((1+I*x)^2/(x^2+1)+1)*arctan(x)+ln(2)*arctan(x)+ln((1+I*x)^2/(x^2+1)+1)*x-1/4*Pi*csgn(I*(
1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)^3+1/4*Pi*csgn(I*((1+I*x)^2/(x^2+1)+1)^2)^3-1/4*Pi*csgn(I*(1+I*x)^2/(
x^2+1))^3+(-1-I*arctan(x)+x*arctan(x))*(x+I)*ln((1+I*x)/(x^2+1)^(1/2))+ln(2)*arctan(x)*x^2-ln((1+I*x)^2/(x^2+1
)+1)*arctan(x)*x^2-1/4*I*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)*csgn(I/((
1+I*x)^2/(x^2+1)+1)^2)*arctan(x)*Pi+1/4*I*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1
)+1)^2)*csgn(I/((1+I*x)^2/(x^2+1)+1)^2)*Pi*x+1/2*I*csgn(I*(1+I*x)^2/(x^2+1))^2*csgn(I*(1+I*x)/(x^2+1)^(1/2))*a
rctan(x)*Pi*x^2+1/4*I*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)^2*arctan(x)*
Pi*x^2-1/4*I*csgn(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(x^2+1)^(1/2))*arctan(x)*Pi-1/2
*I*csgn(I*(1+I*x)^2/(x^2+1))^2*csgn(I*(1+I*x)/(x^2+1)^(1/2))*Pi*x+1/4*I*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*
x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)^2*arctan(x)*Pi-1/4*I*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*x)^2/(x^2+1)/
((1+I*x)^2/(x^2+1)+1)^2)^2*Pi*x-1/4*I*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*x)/(x^2+1)^(1/2))^2*arctan(x)*Pi+1
/4*I*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*x)/(x^2+1)^(1/2))^2*Pi*x

________________________________________________________________________________________

maxima [A]  time = 0.52, size = 39, normalized size = 0.80 \[ -\frac {1}{2} \, {\left (x^{2} - {\left (x^{2} + 1\right )} \log \left (x^{2} + 1\right ) + 1\right )} \arctan \relax (x) - \frac {1}{2} \, x \log \left (x^{2} + 1\right ) + \frac {3}{2} \, x - \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="maxima")

[Out]

-1/2*(x^2 - (x^2 + 1)*log(x^2 + 1) + 1)*arctan(x) - 1/2*x*log(x^2 + 1) + 3/2*x - arctan(x)

________________________________________________________________________________________

mupad [B]  time = 0.47, size = 48, normalized size = 0.98 \[ \frac {\ln \left (x^2+1\right )\,\mathrm {atan}\relax (x)}{2}-x\,\left (\frac {\ln \left (x^2+1\right )}{2}-\frac {3}{2}\right )-x^2\,\left (\frac {\mathrm {atan}\relax (x)}{2}-\frac {\ln \left (x^2+1\right )\,\mathrm {atan}\relax (x)}{2}\right )-\frac {3\,\mathrm {atan}\relax (x)}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*log(x^2 + 1)*atan(x),x)

[Out]

(log(x^2 + 1)*atan(x))/2 - x*(log(x^2 + 1)/2 - 3/2) - x^2*(atan(x)/2 - (log(x^2 + 1)*atan(x))/2) - (3*atan(x))
/2

________________________________________________________________________________________

sympy [A]  time = 1.06, size = 56, normalized size = 1.14 \[ \frac {x^{2} \log {\left (x^{2} + 1 \right )} \operatorname {atan}{\relax (x )}}{2} - \frac {x^{2} \operatorname {atan}{\relax (x )}}{2} - \frac {x \log {\left (x^{2} + 1 \right )}}{2} + \frac {3 x}{2} + \frac {\log {\left (x^{2} + 1 \right )} \operatorname {atan}{\relax (x )}}{2} - \frac {3 \operatorname {atan}{\relax (x )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*atan(x)*ln(x**2+1),x)

[Out]

x**2*log(x**2 + 1)*atan(x)/2 - x**2*atan(x)/2 - x*log(x**2 + 1)/2 + 3*x/2 + log(x**2 + 1)*atan(x)/2 - 3*atan(x
)/2

________________________________________________________________________________________